package org.witsoft.localmq;

import org.witsoft.localmq.model.Offset;
import org.witsoft.localmq.model.Segment;

import java.io.IOException;
import java.util.Collection;

/**
 * @ClassName: LogFileOffsetManager
 * @Description:
 * @Author: Colin
 * @Date: 2020/12/26 11:16 AM
 * @Version 1.0
 **/
public interface OffsetManager {

    long getProduceOffset();

    Offset getOffset(long num);

    Offset nextProduceOffset(long dataSize) throws IOException;

    long getConsumeOffset();

    void commitConsumeOffset(long num) throws IOException;

    Collection<Segment> getSegments();

    void purge() throws IOException;
}
